<?php
//PHP Script to add the registration code to the Database

include('registration.html');

//Manual SQL COnnection
$con = mysql_connect("localhost", "root", "root") or die ( "Error connectiong to DB: ".mysql_error());
       
mysql_select_db("reeferslog", $con) or die ( "Error selecting specific DB, reefeerslog: ".mysql_error());

$username = $_POST['uid'];
$password = $_POST['password'];
$email = $_POST['email'];
$fname = $_POST['fname'];
$lname = $_POST['lname'];


//SQL Insert statement with data
$add_user = "insert into users (user_id, username, password, email, fname, lname) values ('', '$username','$password','$email','$fname','$lname')";

    //Execute Insert command
    if (!mysql_query($add_user,$con))
      {
      die('Error: ' . mysql_error());
      }
    echo "Registration Successful!";

mysql_close($con);

?>